﻿using System.Windows.Media;
using Styx.Common;

namespace FarmerJoe.Helpers
{
    namespace Logging
    {
        class Colours
        {
            public static Color DefaultColour
            {
                get
                {
                    return Colors.DeepSkyBlue;
                }
            }

            public static Color WarningColour
            {
                get
                {
                    return Colors.Red;
                }
            }

            public static Color TakeNoteColour
            {
                get
                {
                    return Color.FromArgb(255, 255, 118, 0);
                }
            }

            public static Color InformativeColour
            {
                get { return Color.FromArgb(255, 255, 206, 0); }
            }
        }

        class Log
        {
            private static string _lastMessage;

            public static void Write(string message)
            {
                Write(Colours.DefaultColour,LogLevel.Normal, message);
            }

            public static void Write(Color colour,string message)
            {
                Write(colour,LogLevel.Normal, message);
            }

            public static void Write(LogLevel logLevel, string message)
            {
                Write(Colours.DefaultColour,logLevel, message);
            }

            public static void Write(Color colour, LogLevel logLevel, string message)
            {
                if (message == _lastMessage) return;

                if (logLevel == LogLevel.Diagnostic) { message = "[FJ Diag] " + message; }

                Styx.Common.Logging.Write(logLevel, colour, message);
                _lastMessage = message;
            }


        }
    }
}
